#! /bin/sh
# shell for uniformly sampling velocity from a layered model
set -v

nz=501 dz=5 fz=.0  labelz="Depth (m)"
nx=1000 dx=20 fx=0.0  labelx="Distance (m)"
ninf=6 npmax=201 
nt=1001
dt=0.004
r1=4
r2=4
input=model.unif2

unif2 < $input ninf=$ninf  npmax=$npmax \
	nz=$nz dz=$dz fz=$fz nx=$nx dx=$dx fx=$fx \
        x0=0.0,0.0,0.0,0.0,0.0,0.0,0.0 \
        z0=0.0,500.0,800.0,900.0,1100.0,1800.0,2200  \
	v00=1500,1500,2300,2300,2500,3000,3000 \
        method=linear |
	suaddhead ns=$nz | sushw key=dt a=5 | sushw key=sx a=300 b=25 |
	sushw key=gx a=700 b=25 > data.temp

# Make a3333
unif2 < $input > a3333 ninf=$ninf npmax=$npmax \
	nz=$nz dz=$dz fz=$fz nx=$nx dx=$dx fx=$fx x0=0,0,0,0,0,0,0 \
	z0=0,500,800,900,1100,1800,2200 \
	v00=1500,1500,1500,1500,1500,1500,1500 \
        dvdz=0,0,0,0,0,0,0,0 dvdx=0,0,0,0,0,0,0
smooth2 < a3333 r1=$r1 r2=$r2 n1=$nz n2=$nx > a3333sm


# Make VP0
unif2 < $input > VP0 ninf=$ninf npmax=$npmax \
        nz=$nz dz=$dz fz=$fz nx=$nx dx=$dx fx=$fx x0=0,0,0,0,0,0,0 \
        z0=0,500,800,900,1100,1800,2200 \
        v00=1500,1500,1500,1500,1500,1500,1500 \
        dvdz=0,0,0,0,0,0,0 dvdx=0,0,0,0,0,0,0
smooth2 < VP0 r1=$r1 r2=$r2 n1=$nz n2=$nx > VP0sm


# Make epsilon
unif2 < $input > epsilon ninf=$ninf npmax=$npmax \
        nz=$nz dz=$dz fz=$fz nx=$nx dx=$dx fx=$fx x0=0,0,0,0,0,0,0 \
        z0=0,500,800,900,1100,1800,2200 \
        v00=0.0,0.0,0.3,0.3,0.0,0.0,0.0 dvdz=0,0,0,0,0,0,0 \
        dvdx=0,0,0,0,0,0,0
smooth2 < epsilon r1=$r1 r2=$r2 n1=$nz n2=$nx > epsilonsm

# Make delta
unif2 < $input > delta ninf=$ninf npmax=$npmax \
        nz=$nz dz=$dz fz=$fz nx=$nx dx=$dx fx=$fx x0=0,0,0,0,0,0,0 \
        z0=0,500,800,900,1100,1800,2200 \
        v00=0.0,0.0,0.1,0.1,0.0,0.0,0.0 dvdz=0,0,0,0,0,0,0 \
        dvdx=0,0,0,0,0,0,0
smooth2 < delta r1=$r1 r2=$r2 n1=$nz n2=$nx > deltasm
